<html xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui">

<f:view>
<f:loadBundle var="text" basename="#{formeList.bundleName}"/>
<h:head>
    <title>#{text['formeList.title']}</title>
    <meta name="heading" content="#{text['formeList.heading']}"/>
    <meta name="menu" content="StockMenu"/>
</h:head>
<body id="formeList">

<div class="span10">
    <h2>#{text['formeList.heading']}</h2>

    <h:form id="searchForm" styleClass="form-search">
    <div id="search" class="input-append">
        <h:inputText id="q" name="q" size="20" value="#{formeList.query}" styleClass="input-medium search-query"/>
        <h:commandButton value="#{text['button.search']}" styleClass="btn" action="#{formeList.search}"/>
    </div>
    </h:form>

    <p>#{text['formeList.message']}</p>

    <h:form id="editForme">

    <div id="actions" class="form-actions">
        <h:commandButton value="#{text['button.add']}" action="add" id="add" immediate="true" styleClass="btn btn-primary"/>
        <h:commandButton value="#{text['button.done']}" action="mainMenu" id="cancel" immediate="true" styleClass="btn"/>
    </div>

    <p:dataTable id="formes" var="forme" value="#{formeList.formes}"
                 sortBy="#{formeList.sortColumn}" paginator="true" rows="25"
                 paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                 rowsPerPageTemplate="5,10,15">
        <p:column>
            <f:facet name="header">
                <p:column sortBy="id">
                    <h:outputText value="#{text['forme.id']}" />
                </p:column>
            </f:facet>
            <h:commandLink action="#{formeForm.edit}" value="#{forme.id}">
                <f:param name="id" value="#{forme.id}"/>
                <f:param name="from" value="list"/>
            </h:commandLink>
        </p:column>
        <p:column>
            <f:facet name="header">
                <p:column sortBy="libelle">
                    <h:outputText value="#{text['forme.libelle']}" />
                </p:column>
            </f:facet>
    <h:outputText value="#{forme.libelle}" escape="true"/>
        </p:column>
    </p:dataTable>
    </h:form>
</div>
</body>
</f:view>
</html> 